<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
    font: inherit;
  }

  body {
    font-family: system-ui, sans-serif;
    min-height: 100vh;
    /*   display: grid;
  place-items: center; */
    background-color: #0d1a2d;
    color: #fff;
  }

  ul:where([role="list"]) {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .container {
    width: min(100% - 2rem, 60rem);
    margin-inline: auto;
  }

  section {
    padding-block: clamp(2rem, 5vw, 5rem);
  }

  .grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns:
      repeat(auto-fit, minmax(min(35ch, 100%), 1fr));
  }

  .section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    font-weight: bold;
    margin-bottom: 0.5em;
  }

  .flex-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
  }

  .flow-content {
    display: grid;
    align-content: start;
    gap: 1rem;
  }

  [data-spacing="sm"] {
    gap: 0.25rem;
  }

  .mx-auto {
    width: fit-content;
    margin-inline: auto;
  }

  .card {
    background-color: #14273e;
    width: min(100% - 2rem, 35ch);
    margin-inline: auto;
    text-align: center;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 0.5rem;
  }

  .card__name {
    font-weight: 700;
  }

  .card__position {
    font-style: italic;
    color: #ccc;
  }

  .card__img {
    width: 5rem;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ddd;
  }

  .card__front {
    padding: 2em 2em 2.5em 2em;
    transition:
      opacity 250ms ease,
      transform 450ms ease;
  }

  .card[data-visible="false"] .card__front {
    opacity: 1;
    transform: translateY(0);
  }

  .card__footer {
    background-color: #0d1a2d;
    height: 1.5rem;
    position: relative;
    z-index: 5;
  }

  .card__back {
    position: absolute;
    padding: 2em 2em 2.5em 2em;
    inset: 0;
    transition:
      transform 450ms ease,
      opacity 150ms ease;
    z-index: 1;
    overflow: auto;
  }

  .card[data-visible="false"] .card__back {
    opacity: 0;
    transform: translateY(100%);
  }

  .card[data-visible="true"] .card__front {
    opacity: 0;
    transform: translateY(100%);
    transition:
      opacity 150ms ease,
      transform 450ms ease 50ms;
  }

  .card[data-visible="true"] .card__back {
    opacity: 1;
    transform: translateY(0);
    transition:
      transform 350ms ease,
      opacity 450ms ease 100ms;
  }

  .card__social {
    justify-content: center;
    margin-bottom: 2em;
  }

  .card__toggle {
    text-align: 1;
    border-radius: 50%;
    width: 3rem;
    aspect-ratio: 1 / 1;
    padding: 0.5em;
    border: 0;
    background-color: teal;
    color: #fff;

    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);

    cursor: pointer;
    transition: background-color 250ms ease;
  }

  .card__toggle-icon {
    transition: rotate 250ms ease;
  }

  .card[data-visible="true"] .card__toggle {
    background-color: crimson;
  }

  .card[data-visible="true"] .card__toggle-icon {
    rotate: 315deg;
  }
</style>

<body>
  <section>
    <div class="container flow-content">
      <h2 class="section-title">Meet the team</h2>
      <ul role="list" class="grid" data-columns="3">
        <li>
          <article class="card" data-visible="false">
            <div data-card="front" class="card__front flow-content">
              <img class="card__img mx-auto"
                src="https://images.unsplash.com/photo-1599566150163-29194dcaad36?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2ODUwMjU1ODF8&ixlib=rb-4.0.3&q=80&w=400"
                alt="John Smith (from Unsplash)" />
              <div class="flow-content" data-spacing="sm">
                <p class="card__name">John Smith</p>
                <p class="card__position">Co-founder & CTO</p>
              </div>
            </div>
            <div data-card="back" class="card__back flow-content">
              <p class="card__name">John Smith</p>
              <q>Empowered teams create truly amazing products. Se the north star and let them follow it.</q>
              <ul role="list" class="card__social flex-group">
                <li>
                  <a href="#">
                    <i class="fa-brands fa-twitter fa-xl"></i>
                  </a>
                </li>
                <li>
                  <a href="#">
                    <i class="fa-brands fa-linkedin fa-xl"></i>
                  </a>
                </li>
              </ul>
            </div>
            <footer class="card__footer">
              <button data-card-controller class="card__toggle">
                <i class="fa-solid fa-plus card__toggle-icon"></i>
              </button>
            </footer>
          </article>
        </li>
        <li>
          <article class="card" data-visible="false">
            <div data-card="front" class="card__front flow-content">
              <img class="card__img mx-auto"
                src="https://images.unsplash.com/photo-1540569014015-19a7be504e3a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2ODUwMjU1ODF8&ixlib=rb-4.0.3&q=80&w=400"
                alt="John Smith (from Unsplash)" />
              <div class="flow-content" data-spacing="sm">
                <p class="card__name">Griffin Wise</p>
                <p class="card__position">Co-founder & CTO</p>
              </div>
            </div>
            <div data-card="back" class="card__back flow-content">
              <p class="card__name">Griffin Wise</p>
              <q>Empowered teams create truly amazing products. Se the north star and let them follow it.</q>
              <ul role="list" class="card__social flex-group">
                <li>
                  <a href="#">
                    <i class="fa-brands fa-twitter fa-xl"></i>
                  </a>
                </li>
                <li>
                  <a href="#">
                    <i class="fa-brands fa-linkedin fa-xl"></i>
                  </a>
                </li>
              </ul>
            </div>
            <footer class="card__footer">
              <button data-card-controller class="card__toggle">
                <i class="fa-solid fa-plus card__toggle-icon"></i>
              </button>
            </footer>
          </article>
        </li>
        <li>
          <article class="card" data-visible="false">
            <div data-card="front" class="card__front flow-content">
              <img class="card__img mx-auto"
                src="https://images.unsplash.com/photo-1539571696357-5a69c17a67c6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2ODUwMzAxNzB8&ixlib=rb-4.0.3&q=80&w=400"
                alt="John Smith (from Unsplash)" />
              <div class="flow-content" data-spacing="sm">
                <p class="card__name">John Smith</p>
                <p class="card__position">Recrutier</p>
              </div>
            </div>
            <div data-card="back" class="card__back flow-content">
              <p class="card__name">John Smith</p>
              <q>Empowered teams create truly amazing products. Se the north star and let them follow it.</q>
              <ul role="list" class="card__social flex-group">
                <li>
                  <a href="#">
                    <i class="fa-brands fa-twitter fa-xl"></i>
                  </a>
                </li>
                <li>
                  <a href="#">
                    <i class="fa-brands fa-linkedin fa-xl"></i>
                  </a>
                </li>
              </ul>
            </div>
            <footer class="card__footer">
              <button data-card-controller class="card__toggle">
                <i class="fa-solid fa-plus card__toggle-icon"></i>
              </button>
            </footer>
          </article>
        </li>
        <li>
          <article class="card" data-visible="false">
            <div data-card="front" class="card__front flow-content">
              <img class="card__img mx-auto"
                src="https://images.unsplash.com/photo-1580489944761-15a19d654956?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2ODUwMzAyODV8&ixlib=rb-4.0.3&q=80&w=400"
                alt="John Smith (from Unsplash)" />
              <div class="flow-content" data-spacing="sm">
                <p class="card__name">John Smith</p>
                <p class="card__position">Co-founder & CTO</p>
              </div>
            </div>
            <div data-card="back" class="card__back flow-content">
              <p class="card__name">John Smith</p>
              <q>Empowered teams create truly amazing products. Se the north star and let them follow it.</q>
              <ul role="list" class="card__social flex-group">
                <li>
                  <a href="#">
                    <i class="fa-brands fa-twitter fa-xl"></i>
                  </a>
                </li>
                <li>
                  <a href="#">
                    <i class="fa-brands fa-linkedin fa-xl"></i>
                  </a>
                </li>
              </ul>
            </div>
            <footer class="card__footer">
              <button data-card-controller class="card__toggle">
                <i class="fa-solid fa-plus card__toggle-icon"></i>
              </button>
            </footer>
          </article>
        </li>
        <li>
          <article class="card" data-visible="false">
            <div data-card="front" class="card__front flow-content">
              <img class="card__img mx-auto"
                src="https://images.unsplash.com/photo-1552058544-f2b08422138a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2ODUwMzAyMjl8&ixlib=rb-4.0.3&q=80&w=400"
                alt="John Smith (from Unsplash)" />
              <div class="flow-content" data-spacing="sm">
                <p class="card__name">John Smith</p>
                <p class="card__position">Designer</p>
              </div>
            </div>
            <div data-card="back" class="card__back flow-content">
              <p class="card__name">John Smith</p>
              <q>Empowered teams create truly amazing products. Se the north star and let them follow it.</q>
              <ul role="list" class="card__social flex-group">
                <li>
                  <a href="#">
                    <i class="fa-brands fa-twitter fa-xl"></i>
                  </a>
                </li>
                <li>
                  <a href="#">
                    <i class="fa-brands fa-linkedin fa-xl"></i>
                  </a>
                </li>
              </ul>
            </div>
            <footer class="card__footer">
              <button data-card-controller class="card__toggle">
                <i class="fa-solid fa-plus card__toggle-icon"></i>
              </button>
            </footer>
          </article>
        </li>
        <li>
          <article class="card" data-visible="false">
            <div data-card="front" class="card__front flow-content">
              <img class="card__img mx-auto"
                src="https://images.unsplash.com/photo-1615813967515-e1838c1c5116?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2ODUwMzAyMjl8&ixlib=rb-4.0.3&q=80&w=400"
                alt="John Smith (from Unsplash)" />
              <div class="flow-content" data-spacing="sm">
                <p class="card__name">John Smith</p>
                <p class="card__position">Developer</p>
              </div>
            </div>
            <div data-card="back" class="card__back flow-content">
              <p class="card__name">John Smith</p>
              <q>Empowered teams create truly amazing products. Se the north star and let them follow it.</q>
              <ul role="list" class="card__social flex-group">
                <li>
                  <a href="#">
                    <i class="fa-brands fa-twitter fa-xl"></i>
                  </a>
                </li>
                <li>
                  <a href="#">
                    <i class="fa-brands fa-linkedin fa-xl"></i>
                  </a>
                </li>
              </ul>
            </div>
            <footer class="card__footer">
              <button data-card-controller class="card__toggle">
                <i class="fa-solid fa-plus card__toggle-icon"></i>
              </button>
            </footer>
          </article>
        </li>
      </ul>
    </div>
  </section>
</body>
<script>
  const cardControllers = document.querySelectorAll("[data-card-controller]");
  const cardFront = document.querySelector("[data-card='front']");
  const cardBack = document.querySelector("[data-card='back']");
  const {log} = console;

  cardControllers.forEach(controller => {
    controller.addEventListener("click", (e) => {
      const card = e.currentTarget.parentElement.parentElement;
      const isVisible = card.dataset.visible;

      if (isVisible === "false") {
        card.setAttribute("data-visible", true);
        log("changed");
      } else {
        card.setAttribute("data-visible", false);
      }
    })
  })
</script>

</html>